<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@include file="/includes.jsp"%>

<h1 class="layout">Change State</h1>

<html:errors/>

<html:form action="changeState.do?method=changeState" enctype="multipart/form-data">
    <html:hidden name="changeStateActionForm" property="stateId"/>
    <table class="layout">
        <tr>
            <th class="layout">Transition:</th>
            <td class="layout">
                <html:select property="transitionId">
                    <html:options collection="transitionPairs" property="id" labelProperty="name"/>
                </html:select>
            </td>
        </tr>
        <tr>
            <th class="layout">Message:</th>
            <td class="layout"><html:textarea name="nodeValue" property="description" value='' cols="60" rows="10"/></td>
        </tr>
        <tr>
            <th class="layout">% Complete:</th>
            <td class="layout">
                <html:select name="changeStateActionForm" property="percentageComplete">
                    <html:options collection="completePairs" property="integer" labelProperty="string"/>
                </html:select>
            </td>
        </tr>
        <tr>
            <th class="layout">Remaining Duration:</th>
            <td class="layout">
                <html:select name="changeStateActionForm" property="durationDays">
                    <html:options collection="durationDays" property="integer" labelProperty="string"/>
                </html:select>day:<html:select name="changeStateActionForm" property="durationHours">
                    <html:options collection="durationHours" property="integer" labelProperty="string"/>
                </html:select>hr:<html:select name="changeStateActionForm" property="durationMins">
                    <html:options collection="minutes" property="integer" labelProperty="string"/>
                </html:select>min
            </td>
        </tr>
        <tr>
            <th class="layout">Attachment</th>
            <td class="layout"><html:file property="file" size="60"/></td>
        </tr>
        <logic:equal name="permissionTimeCreate" value="true">
            <tr>
                <th class="layout">Assign Time:</th>
                <td class="layout"><html:checkbox name="changeStateActionForm" property="assignTime"/></td>
            </tr>
            <tr>
                <th class="layout">Date:</th>
                <td class="layout">
                    <html:select name="changeStateActionForm" property="year" size="1">
                        <html:options collection="years" property="integer" labelProperty="string"/>
                    </html:select>-<html:select name="changeStateActionForm" property="month" size="1">
                        <html:options collection="months" property="integer" labelProperty="string"/>
                    </html:select>-<html:select name="changeStateActionForm" property="day" size="1">
                        <html:options collection="days" property="integer" labelProperty="string"/>
                    </html:select>
                   Start:<html:select name="changeStateActionForm" property="startHour" size="1">
                        <html:options collection="hours" property="integer" labelProperty="string"/>
                    </html:select>h:<html:select name="changeStateActionForm" property="startMinute" size="1">
                        <html:options collection="minutes" property="integer" labelProperty="string"/>
                    </html:select>
                    Stop:<html:select name="changeStateActionForm" property="stopHour" size="1">
                        <html:options collection="hours" property="integer" labelProperty="string"/>
                    </html:select>h:<html:select name="changeStateActionForm" property="stopMinute" size="1">
                        <html:options collection="minutes" property="integer" labelProperty="string"/>
                    </html:select>
                </td>
            </tr>
        </logic:equal>
    </table>
    <div class="buttons">
        <html:submit property="btnSubmit" value="OK"/>
        <html:cancel property="btnSubmit" value="Cancel"/>
    </div>
</html:form>
